import { BaseDomain } from '@admin/common/domain/BaseDomain';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsNotEmpty, IsNumber, IsString, IsOptional } from 'class-validator';
import { queryDomain } from '@admin/common/domain/queryDomain';
/**@description 查询姓氏管理Dto */
export class QueryJpSurnameDto extends queryDomain {
  @ApiProperty({ description: '姓氏' })
  @IsOptional()
  name: string | null;
  @ApiProperty({ description: '图腾' })
  @IsOptional()
  avatar: string | null;
  @ApiProperty({ description: '得姓方式' })
  @IsOptional()
  way: string | null;
  @ApiProperty({ description: '得姓始祖' })
  @IsOptional()
  ancestor: string | null;
  @ApiProperty({ description: '姓氏介绍' })
  @IsOptional()
  introduce: string | null;
  @ApiProperty({ description: '状态(0禁用，1正常)' })
  @IsOptional()
  status: string | null;
}
/**@description 创建姓氏管理Dto */
export class CreateJpSurnameDto {
  @ApiProperty({ description: '姓氏' })
  @IsNotEmpty({ message: '姓氏不能为空' })
  @IsString()
  name: string;
  @ApiProperty({ description: '图腾' })
  @IsOptional()
  @IsString()
  avatar?: string;
  @ApiProperty({ description: '得姓方式' })
  @IsOptional()
  @IsString()
  way?: string;
  @ApiProperty({ description: '得姓始祖' })
  @IsOptional()
  @IsString()
  ancestor?: string;
  @ApiProperty({ description: '姓氏介绍' })
  @IsOptional()
  @IsString()
  introduce?: string;
  @ApiProperty({ description: '状态(0禁用，1正常)' })
  @IsNotEmpty({ message: '状态(0禁用，1正常)不能为空' })
  @IsString()
  status: string;
  @ApiProperty({ description: '注册时间' })
  @IsOptional()
  @IsString()
  createTime?: string;
  @ApiProperty({ description: '修改时间' })
  @IsOptional()
  @IsString()
  updateTime?: string;
}
/**@description 更新姓氏管理Dto */
export class UpdateJpSurnameDto {
  @ApiProperty({ description: 'ID' })
  @IsNotEmpty({ message: 'ID不能为空' })
  @Transform(v => +v.value)
  @IsNumber()
  id: number;
  @ApiProperty({ description: '姓氏' })
  @IsNotEmpty({ message: '姓氏不能为空' })
  @IsString()
  name: string;
  @ApiProperty({ description: '图腾' })
  @IsOptional()
  @IsString()
  avatar?: string;
  @ApiProperty({ description: '得姓方式' })
  @IsOptional()
  @IsString()
  way?: string;
  @ApiProperty({ description: '得姓始祖' })
  @IsOptional()
  @IsString()
  ancestor?: string;
  @ApiProperty({ description: '姓氏介绍' })
  @IsOptional()
  @IsString()
  introduce?: string;
  @ApiProperty({ description: '状态(0禁用，1正常)' })
  @IsNotEmpty({ message: '状态(0禁用，1正常)不能为空' })
  @IsString()
  status: string;
  @ApiProperty({ description: '修改时间' })
  @IsOptional()
  @IsString()
  updateTime?: string;
}
